//
//  UnLogChargeTableViewCell.m
//  WideHelp
//
//  Created by ENERGY on 2018/8/10.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "UnLogChargeTableViewCell.h"

@interface UnLogChargeTableViewCell ()
@property (nonatomic, strong)UIView * whiteBGView;
@property (nonatomic, strong)UIButton * circleBtn;
@property (nonatomic, strong)UILabel * nameLab;
@property (nonatomic, strong)UILabel * projectLab;
@property (nonatomic, strong)UILabel * moneyLab;

@end

@implementation UnLogChargeTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = getColor(@"f5f5f5");
        __weak typeof (self)weakSelf = self;
        [self.contentView addSubview:self.whiteBGView];
        [self.contentView addSubview:self.circleBtn];
        [self.contentView addSubview:self.nameLab];
        [self.contentView addSubview:self.projectLab];
        [self.contentView addSubview:self.moneyLab];
        [self.whiteBGView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(weakSelf.contentView);
            make.top.equalTo(weakSelf.contentView.mas_top).mas_offset(15/WIDTH_6_SCALE);
        }];
        [self.circleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.contentView.mas_left).mas_offset(13/WIDTH_6_SCALE);
            make.centerY.equalTo(weakSelf.whiteBGView.mas_centerY);
            make.height.width.mas_offset(22/WIDTH_6_SCALE);
        }];
        [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.circleBtn.mas_right).mas_offset(18/WIDTH_6_SCALE);
            make.top.equalTo(weakSelf.whiteBGView.mas_top).mas_offset(34/WIDTH_6_SCALE);
            make.height.mas_offset(18/WIDTH_6_SCALE);
        }];
        [self.projectLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(weakSelf.nameLab.mas_bottom).mas_offset(12/WIDTH_6_SCALE);
            make.left.equalTo(weakSelf.nameLab);
            make.height.mas_offset(13/WIDTH_6_SCALE);
        }];
        [self.moneyLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.whiteBGView.mas_right).mas_offset(-122/WIDTH_6_SCALE);
            make.height.centerY.equalTo(weakSelf.nameLab);
            make.right.equalTo(weakSelf.whiteBGView.mas_right).mas_offset(-13/WIDTH_6_SCALE);
        }];
    }return self;
}
- (UIView *)whiteBGView{
    if (!_whiteBGView) {
        _whiteBGView = [[UIView alloc] init];
        _whiteBGView.backgroundColor = [UIColor whiteColor];
    }return _whiteBGView;
}
- (UIButton *)circleBtn{
    if (!_circleBtn) {
        _circleBtn = [[UIButton alloc] init];
        [_circleBtn setBackgroundColor:[UIColor redColor]];
    }return _circleBtn;
}

- (UILabel *)nameLab{
    if (!_nameLab) {
        _nameLab = [[UILabel alloc] init];
        _nameLab.font = DEF_FontSize_14;
        _nameLab.textColor = [UIColor blackColor];
        _nameLab.textAlignment = NSTextAlignmentLeft;
        _nameLab.text = @"用户名";
    }return _nameLab;
}
- (UILabel *)projectLab{
    if (!_projectLab) {
        _projectLab = [[UILabel alloc] init];
        _projectLab.font = DEF_FontSize_12;
        _projectLab.textColor = [UIColor blackColor];
        _projectLab.textAlignment = NSTextAlignmentLeft;
        _projectLab.text = @"互助计划";
    }return _projectLab;
}
- (UILabel *)moneyLab{
    if (!_moneyLab) {
        _moneyLab = [[UILabel alloc] init];
        _moneyLab.font = DEF_FontSize_14;
        _moneyLab.textColor = [UIColor redColor];
        _moneyLab.textAlignment = NSTextAlignmentLeft;
        _moneyLab.text = @"￥登陆后可见";
    }return _moneyLab;
}

@end
